/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package servlet;

import dao.MemberDao;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author zhang
 */
@WebServlet("/fus")
public class ForbidUserServlet extends HttpServlet{

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        int type=Integer.parseInt(req.getParameter("type"));
        int userId=Integer.parseInt(req.getParameter("userid"));
        if(type==1){
            new MemberDao().forbidUser(userId);
        }else{
            new MemberDao().openUser(userId);
        }
        resp.sendRedirect("Admin.jsp");
    }
    
}
